package com.lgmshare.k3.ui.common.viewholder;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;

import com.lgmshare.component.annotation.LayoutRes;
import com.lgmshare.component.widget.recyclerview.HeaderFooterViewHolder;
import com.lgmshare.k3.R;
import com.lgmshare.k3.ui.common.model.BaseListFooterValue;

import butterknife.BindView;
import butterknife.ButterKnife;

@LayoutRes(resId = R.layout.base_list_footer_item)
public class BaseListFooterViewHolder extends HeaderFooterViewHolder<BaseListFooterValue> {

    @BindView(R.id.tv_content)
    TextView tvContent;

    public BaseListFooterViewHolder(Context context, View itemView) {
        super(context, itemView);
        ButterKnife.bind(this, itemView);
    }

    @Override
    public void onBind(BaseListFooterValue value) {
        if (TextUtils.isEmpty(value.getContent())) {
            tvContent.setVisibility(View.GONE);
        } else {
            tvContent.setVisibility(View.VISIBLE);
            tvContent.setText(value.getContent());
        }
    }
}
